# -*- coding = utf-8 -*-
# name   : 
# Author : admin
# Email  : 
# File   : log_config.py
# Ver    : 1.0
# Time   : 2025-07-21 17:03
import logging

from copy import deepcopy
from uvicorn.config import LOGGING_CONFIG

fmt = '%(asctime)s %(levelname)s: %(message)s - %(filename)s[line:%(lineno)d]'
datefmt = '%Y-%m-%d %H:%M:%S'

logging.basicConfig(level=logging.INFO,
                    datefmt=datefmt,
                    format=fmt)

custom_logging_config = deepcopy(LOGGING_CONFIG)
custom_logging_config['formatters']['default']['fmt'] = fmt
custom_logging_config['formatters']['access']['fmt'] = fmt
custom_logging_config['formatters']['default']['datefmt'] = datefmt
custom_logging_config['formatters']['access']['datefmt'] = '%Y/%m/%d %H:%M:%S'